package workqueue;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import util.RabbitUtil;

import java.io.IOException;

public class Provider {

  public static void main(String[] args) throws IOException {

    Connection connection = RabbitUtil.getConnection();

    Channel channel = connection.createChannel();

    channel.queueDeclare( "work" , false, false,  false ,  null);

    for (int i = 0; i < 20; i++) {
      channel.basicPublish("","work",null,(i + "hello work queue").getBytes());
    }

    RabbitUtil.closeConnectionAndChannel(channel,connection);
  }
}
